# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from typing import Union
from fastapi import Query
from pydantic import BaseModel, Field


class MusicStylesSearchIn(BaseModel):
    """ 音乐风格搜索参数 """
    page_no: int = Query(default=1, gt=0, description="当前页码")
    page_size: int = Query(default=15, gt=0, le=200, description="每页条数")
    name: Union[str, None] = Query(default=None, description="风格名称")
    is_disable: Union[int, str, None] = Query(default=None, description="是否禁用: [0=否,1=是]")
    start_time: Union[str, None] = Query(default=None, description="开始时间")
    end_time: Union[str, None] = Query(default=None, description="结束时间")


class MusicStylesAddIn(BaseModel):
    """ 音乐风格新增参数 """
    image: str = Field(..., min_length=1, max_length=250, description="图标")
    name: str = Field(..., min_length=1, max_length=100, description="名称")
    value: str = Field(..., min_length=1, max_length=200, description="键值")
    sort: int = Field(default=0, ge=0, le=99999999, description="排序编号")
    is_disable: int = Field(..., ge=0, le=1, description="是否禁用: [0=否, 1=是]")


class MusicStylesEditIn(BaseModel):
    """ 音乐风格编辑参数 """
    id: int = Field(..., gt=0, description="ID")
    image: str = Field(..., min_length=1, max_length=250, description="图标")
    name: str = Field(..., min_length=1, max_length=100, description="名称")
    value: str = Field(..., min_length=1, max_length=200, description="键值")
    sort: int = Field(default=0, ge=0, le=99999999, description="排序编号")
    is_disable: int = Field(..., ge=0, le=1, description="是否禁用: [0=否, 1=是]")


class MusicStylesDeleteIn(BaseModel):
    """ 音乐风格删除参数 """
    id: int = Field(..., gt=0, description="ID")


"""--------------- Separator ---------------"""


class MusicStylesVo(BaseModel):
    """ 音乐风格列表Vo """
    id: int = Field(description="ID")
    image: str = Field(description="封面图标")
    name: str = Field(description="风格名称")
    value: str = Field(description="风格键值")
    sort: int = Field(description="排序编号")
    is_disable: int = Field(description="是否禁用: [0=否, 1=是]")
    create_time: str = Field(description="创建时间")
